package com.taxigang.client.ui.map;

import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
import com.google.gwt.user.client.ui.Image;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.taxigang.client.Session;
import com.taxigang.client.Session.UserAgent;

public class ProcessingDialog {
	/**
	 * Initialize this example.
	 */
	/**
	 * Create the dialog box for this example.
	 *
	 * @return the new dialog box
	 */
	final static DialogBox dialogBox1 = new DialogBox(true);
	public static void show(String message) {
		if (!UserAgent.PC_WEBKIT.equals(Session.getInstance().getUserAgent())){
			// Create a dialog box and set the caption text
			
			dialogBox1.setHTML("<p><b>"+message+"</b></p>");
			//Window.alert(dialogBox.getHTML());
			
			// Create a table to layout the content
			VerticalPanel dialogContents = new VerticalPanel();
			dialogContents.setSpacing(4);
			dialogBox1.setWidget(dialogContents);
	
	
			// Add an image to the dialog
			Image image = new Image("images/ajax-loader-bar.gif");
			dialogContents.add(image);
			dialogContents.setCellHorizontalAlignment(
					image, HasHorizontalAlignment.ALIGN_CENTER);
	
	
			// Return the dialog box
			dialogBox1.setGlassEnabled(true);
			dialogBox1.setAnimationEnabled(true);
	
	
			dialogBox1.center();
			dialogBox1.show();
		}
	}

	public static void hide(){
		dialogBox1.hide();

	}
}
